import React from 'react';
import { Redirect, Route, Switch, withRouter } from 'react-router-dom';
import Routers from './routers/index.tsx';

function App() {
  return (
    <Switch>
      {Routers.map((router) => (
        <Route
          exact={!router.notExect}
          key={router.path}
          path={router.path}
          component={router.component}
        />
      ))}
      {/* 设置默认路由 */}
      <Redirect path="/" to="/home" />
    </Switch>
  );
}

export default withRouter(App);

